package org.lucky_common.query;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class BaseQuery {
    private String sortField;
    private String sortType;
    //关键字
    private String keyword;
    //有公共属性-分页
    private Integer currentPage = 1; //当前页
    private Integer pageSize = 10; //每页显示多少条
    private String start;
    private String end;

    public String getKeyword() {
        return keyword;
    }

    public void setKeyword(String keyword) {
        this.keyword = keyword;
    }

    public Integer getPage() {
        return currentPage == null ? 1 : currentPage;
    }

    public void setPage(Integer page) {
        this.currentPage = page;
    }

    public Integer getRows() {
        return pageSize == null ? 10 : pageSize;
    }

    public void setRows(Integer rows) {
        this.pageSize = rows;
    }

    public String getSortField() {
        return sortField;
    }

    public void setSortField(String sortField) {
        this.sortField = sortField;
    }

    public String getSortType() {
        return sortType;
    }

    public void setSortType(String sortType) {
        this.sortType = sortType;
    }
}